import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:求一个整数二进制中1的个数
 * User: xwl
 * Date: 2023-03-30
 * Time: 21:12
 */
public class Test6 {
    public static void main(String[] args) {
        //00000000 00000000 00000000 00000001 - 1
        //11111111 11111111 11111111 11111111 - -1
        //10000000 00000000 00000000 00000000 - -128
        //01111111 11111111 11111111 11111111

        //定义一个计数器
        int count = 0;
        //循环输入
        Scanner scan = new Scanner(System.in);
        while(scan.hasNextInt()) {
            int num = scan.nextInt();
            //通过num与num-1来寻找num中的1
            while(num != 0) {
                num = num & (num-1);
                count++;
            }
            //输出
            System.out.println(count);
            count = 0;
        }
    }
}
